package com.production.CoursePlatform.controller;

import com.production.CoursePlatform.entity.Course;
import com.production.CoursePlatform.service.CourseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/course")
public class CourseController {
    //此接口已检验
    @Autowired
    private CourseService courseService;

    //http://localhost:8080/course/teacher?tID
    @GetMapping("/teacher")
    public List<Course> teacherCourse(@RequestParam String tID) {
        return courseService.teacherCourse(tID);
    }
    //http://localhost:8080/course/teacher?tID
    @GetMapping("/student")
    public List<Course> studentCourse(@RequestParam String sID) {
        return courseService.studentCourse(sID);
    }
}
